Skip to content

[None][feat] Support DeepSeek-V4 model#14751

Closed
lfr-0531 wants to merge 58 commits into
NVIDIA:mainfrom
lfr-0531:user/fanrongl/dsv4_model
Closed

[None][feat] Support DeepSeek-V4 model#14751
lfr-0531 wants to merge 58 commits into
NVIDIA:mainfrom
lfr-0531:user/fanrongl/dsv4_model

Conversation

@lfr-0531

@lfr-0531 lfr-0531 commented May 29, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai summary

Description

This PR adds end-to-end support for the DeepSeek-V4 model on the PyTorch backend.
DeepSeek-V4 introduces sparse-MLA attention, and this change brings in the full path:
the compressor / indexer kernels and sparse KV-cache management, the QK-norm fused op,
MoE enablement (MEGAMOE DeepGEMM, EPLB), tokenizer chat-template handling, and the
tool / reasoning parsers. The change set is intentionally large; please refer to the
commit history for the per-feature breakdown.

Test Coverage

  • unittest/_torch/attention/sparse/deepseek_v4/* — sparse MLA, cache manager,
    indices transform, o_proj, compressor kernel / module / tf32
  • unittest/_torch/modeling/test_modeling_deepseekv4.py
  • unittest/llmapi/test_deepseek_v4_tokenizer.py
  • accuracy/test_llm_api_pytorch.py::TestDeepSeekV3Lite::test_bfloat16_2_model_mtp

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths.

  • If PR introduces API changes, an appropriate PR label is added.

  • Any new dependencies have been scanned for license and vulnerabilities.

  • CODEOWNERS updated if ownership changes.

  • Documentation updated as needed.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

@lfr-0531
lfr-0531 force-pushed the user/fanrongl/dsv4_model branch from e1c544f to aa1c243 Compare May 29, 2026 16:16
@lfr-0531 lfr-0531 added the api-compatible Accepted LLM API contract change that is backwards-compatible label May 29, 2026
@lfr-0531

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51063 [ run ] triggered by Bot. Commit: aa1c243 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51063 [ run ] completed with state SUCCESS. Commit: aa1c243
/LLM/main/L0_MergeRequest_PR pipeline #40508 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@lfr-0531
lfr-0531 force-pushed the user/fanrongl/dsv4_model branch 2 times, most recently from 2608a8d to 94a2f25 Compare May 30, 2026 02:14
@lfr-0531

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51198 [ run ] triggered by Bot. Commit: 94a2f25 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51198 [ run ] completed with state FAILURE. Commit: 94a2f25
/LLM/main/L0_MergeRequest_PR pipeline #40626 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@lfr-0531

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51248 [ run ] triggered by Bot. Commit: 94a2f25 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51248 [ run ] completed with state SUCCESS. Commit: 94a2f25
/LLM/main/L0_MergeRequest_PR pipeline #40670 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@lfr-0531
lfr-0531 force-pushed the user/fanrongl/dsv4_model branch from 94a2f25 to 486b7d5 Compare May 31, 2026 13:58
@lfr-0531

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51256 [ run ] triggered by Bot. Commit: 486b7d5 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51256 [ run ] completed with state FAILURE. Commit: 486b7d5
/LLM/main/L0_MergeRequest_PR pipeline #40677 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@lfr-0531

lfr-0531 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51273 [ run ] triggered by Bot. Commit: 486b7d5 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51273 [ run ] completed with state SUCCESS. Commit: 486b7d5
/LLM/main/L0_MergeRequest_PR pipeline #40693 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@lfr-0531

lfr-0531 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51331 [ run ] triggered by Bot. Commit: 486b7d5 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51331 [ run ] completed with state FAILURE. Commit: 486b7d5
/LLM/main/L0_MergeRequest_PR pipeline #40741 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@lfr-0531

lfr-0531 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

1 similar comment
@lfr-0531

lfr-0531 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@lfr-0531
lfr-0531 force-pushed the user/fanrongl/dsv4_model branch from 486b7d5 to 5de630c Compare June 1, 2026 15:21
@lfr-0531

lfr-0531 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51370 [ run ] triggered by Bot. Commit: 5de630c Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51370 [ run ] completed with state FAILURE. Commit: 5de630c
/LLM/main/L0_MergeRequest_PR pipeline #40781 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

mingyangHao and others added 28 commits June 17, 2026 01:19
… RMSNorm fold-in (NVIDIA#13892)

Signed-off-by: Mingyang Hao <mingyangh@nvidia.com>
Signed-off-by: mingyangh <mingyangh@nvidia.com>
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com>
Co-authored-by: Mingyang Hao <mingyangHao@users.noreply.github.com>
(cherry picked from commit 50aa581)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Tracin <10434017+Tracin@users.noreply.github.com>
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Co-authored-by: Tracin <10434017+Tracin@users.noreply.github.com>
Co-authored-by: Fanrong Li <lfr-0531@users.noreply.github.com>
(cherry picked from commit 8eccf23)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Tracin <10434017+Tracin@users.noreply.github.com>
Signed-off-by: Barry Kang <jinshik@nvidia.com>
Co-authored-by: Barry Kang <jinshik@nvidia.com>
(cherry picked from commit 13888d2)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
…14129)

Signed-off-by: Barry Kang <43644113+Barry-Delaney@users.noreply.github.com>
(cherry picked from commit 7964767)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Jin Li <59594262+liji-nv@users.noreply.github.com>
(cherry picked from commit 15ac239)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
…DIA#14074)

Signed-off-by: Xianjie <5410381+qiaoxj07@users.noreply.github.com>
(cherry picked from commit d178370)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com>
(cherry picked from commit 5cf6e6a)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
NVIDIA#14124)

Signed-off-by: Mingyang Hao <mingyangh@nvidia.com>
(cherry picked from commit 82ebfc7)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Mingyang Hao <mingyangh@nvidia.com>
(cherry picked from commit 4aad70b)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Barry Kang <43644113+Barry-Delaney@users.noreply.github.com>
Co-authored-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Co-authored-by: Barry Kang <43644113+Barry-Delaney@users.noreply.github.com>
(cherry picked from commit e6339b5)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
…A#14000)

Signed-off-by: Barry Kang <43644113+Barry-Delaney@users.noreply.github.com>
(cherry picked from commit 12b8105)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Mike Iovine <miovine@nvidia.com>
Signed-off-by: Mike Iovine <6158008+mikeiovine@users.noreply.github.com>
Signed-off-by: Fanrong Li <23290157+lfr-0531@users.noreply.github.com>
Co-authored-by: Fanrong Li <23290157+lfr-0531@users.noreply.github.com>
(cherry picked from commit 7fbe349)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com>
Signed-off-by: Mingyang Hao <mingyangh@nvidia.com>
Co-authored-by: Mingyang Hao <mingyangHao@users.noreply.github.com>
(cherry picked from commit f833ad7)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Shicheng Li <shicli@nvidia.com>
(cherry picked from commit d7d9036)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Co-authored-by: Fanrong Li <lfr-0531@users.noreply.github.com>
(cherry picked from commit 5af1511)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
…IDIA#14238)

Signed-off-by: Barry Kang <43644113+Barry-Delaney@users.noreply.github.com>
(cherry picked from commit 552de9e)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
…ymmBuffer (NVIDIA#14213)

Signed-off-by: Xianjie <5410381+qiaoxj07@users.noreply.github.com>
(cherry picked from commit 5a72fb3)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
…VIDIA#14219)

Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
(cherry picked from commit bef645d)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
…ttn (NVIDIA#14321)

Signed-off-by: Iman Tabrizian <10105175+Tabrizian@users.noreply.github.com>
(cherry picked from commit 349f087)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
…#14299)

Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Co-authored-by: Fanrong Li <lfr-0531@users.noreply.github.com>
(cherry picked from commit 5d0a30e)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Filtered out disaggregation and AutoDeploy-only changes for user/fanrongl/dsv4_model.

Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Jin Li <59594262+liji-nv@users.noreply.github.com>
(cherry picked from commit 325152c)
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
…eam` (NVIDIA#14245)

Signed-off-by: Barry Kang <43644113+Barry-Delaney@users.noreply.github.com>
Signed-off-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Co-authored-by: peihengh <259410613+peihu-nv@users.noreply.github.com>
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
…4241)

Signed-off-by: Lanyu Liao <lancelly@users.noreply.github.com>
Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com>
Co-authored-by: Lanyu Liao <lancelly@users.noreply.github.com>
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
…ety (NVIDIA#14297)

Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
@lfr-0531
lfr-0531 force-pushed the user/fanrongl/dsv4_model branch from 9c86293 to 948ee55 Compare June 17, 2026 03:16
@lfr-0531 lfr-0531 closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-compatible Accepted LLM API contract change that is backwards-compatible

Projects

None yet

Development

Successfully merging this pull request may close these issues.